<template>
	<view class="container">
		<view @tap="goVideoplay(item.nodeId,item.newsId)" v-for="(item,index) in listRecord" :key="item.originCourseId" class="classlistcont">
			<view class="imgCont"><image :src="item.cover"></image></view>
			<view class="classdetailCont">
				<text class="classtitle">{{item.courseName}}</text>
				<view class="studyprocess">已学{{`${(item.learningProgress * 100).toFixed(2)}%` || ''}}</view>
				<view class="studydetail">
					<image src="../../../static/image/onlineschool/playicon.png"></image>
					<text>上次学到:课时{{item.currentEpisodeNumber}} {{item.currentEpisodeName}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { listRecord } from '@/http/api.js'
	export default {
		data() {
			return {
				listRecord: []
			}
		},
		onShow(){
			this.getListRecord()
		},
		methods: {
			getListRecord(){
				this.$request({
					url: listRecord,
				}).then( res => {
					this.listRecord = res
				})
			},
			goVideoplay(nodeId,newsId){
				this.toAutorize()
				this.goPage('../videoplay/index',{nodeId: nodeId,newsId: newsId})
			}
		}
	}
</script>

<style lang="scss">
	@import "../index/index.scss";
</style>
